//
//  PublicTabPageViewController.h
//  PageControllerTest
//
//  Created by Seven-Augus on 2017/3/29.
//  Copyright © 2017年 Seven-Augus. All rights reserved.
//

#import "PublicPageViewController.h"

@class PublicTabPageViewController;

@protocol PublicTabPageViewControllerDelegate <PublicPageViewControllerDelegate>

// configre collectionview cell
- (void)pagerController:(PublicTabPageViewController *)pagerController configreCell:(UICollectionViewCell *)cell forItemTitle:(NSString *)title atIndexPath:(NSIndexPath *)indexPath;

// transition frome cell to cell with animated
- (void)pagerController:(PublicTabPageViewController *)pagerController transitionFromeCell:(UICollectionViewCell *)fromCell toCell:(UICollectionViewCell *)toCell animated:(BOOL)animated;

// transition frome cell to cell with progress
- (void)pagerController:(PublicTabPageViewController *)pagerController transitionFromeCell:(UICollectionViewCell *)fromCell toCell:(UICollectionViewCell *)toCell progress:(CGFloat)progress;

@end

typedef NS_ENUM(NSUInteger, PublicPageBarStyle) {
    PublicPageBarStyleNoneView,
    PublicPageBarStyleProgressView,
    PublicPageBarStyleProgressBounceView,
    PublicPageBarStyleCoverView
};


@interface PublicTabPageViewController : PublicPageViewController

#pragma clang diagnostic push
#pragma clang diagnostic ignored"-Wobjc-property-synthesis"
@property (nonatomic, weak) id<PublicTabPageViewControllerDelegate> delegate;
#pragma clang diagnostic pop

// view ,don't change frame
@property (nonatomic, weak, readonly) UIView *pagerBarView; // pagerBarView height is contentTopEdging
@property (nonatomic, weak, readonly) UICollectionView *collectionViewBar;
@property (nonatomic, weak, readonly) UIView *progressView;

@property (assign, nonatomic) CGFloat pagerBarViewRightSpacing;//pagerBarView 右边距
@property (nonatomic, assign) PublicPageBarStyle barStyle; // set style will reset progress propertys, set it behind [super viewdidload]

// progress view
@property (nonatomic, assign) CGFloat progressHeight;
@property (nonatomic, assign) CGFloat progressEdging; // if < 0 width + edge ,if >0 width - edge
@property (nonatomic, assign) CGFloat progressWidth; //if>0 progress width is equal,else progress width is cell width

// cell
@property (nonatomic, assign) CGFloat cellWidth; // if>0 cells width is equal,else if=0 cell will caculate all titles width
@property (nonatomic, assign) CGFloat cellSpacing; // cell space
@property (nonatomic, assign) CGFloat cellEdging;  // cell left right edge

//   animate duration
@property (nonatomic, assign) CGFloat animateDuration;

// text font
@property (nonatomic, strong) UIFont *normalTextFont;
@property (nonatomic, strong) UIFont *selectedTextFont;

// if you custom cell ,you must register cell
- (void)registerCellClass:(Class)cellClass isContainXib:(BOOL)isContainXib;

// get cell at index
- (UICollectionViewCell *)cellForIndex:(NSInteger)index;

// get cell frame at index
- (CGRect)cellFrameWithIndex:(NSInteger)index;

@end
